/*
package com.hmall.trade.listener;

import com.hmall.common.constants.MqConstants;
import com.hmall.trade.domain.po.Order;
import com.hmall.trade.service.IOrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class OrderDealyMessageListener {
    private final IOrderService iOrderService;


    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name= MqConstants.DELAY_ORDER_QUEUE_NAME),
            exchange =@Exchange(value=MqConstants.DELAY_EXCHANGE_NAME,delayed="true"),
            key = MqConstants.DELAY_ORDER_KEY
    ))
    public void listener(Long orderId){
 //查询订单
Order order = iOrderService.getById(orderId);

        //检测订单状态，判断是否支付
        if(order ==null || order.getStatus()!=1) {
  return;
        }
            //订单状态如果是未支付需要查询支付单状态(pay服务里pay_order表的支付状态)

        int status;
          if(order.getStatus()==1){
              status =
          }

            //判断是否已支付

            //如果已经支付，将订单状态修改为已支付待发货


        //否则取消订单，回滚库存(查询订单里有哪些商品，每个商品买了几个)
    }
}
*/
